package advanced.comparator;

import java.util.Comparator;

public class StudentNameComparator implements Comparator<Student>{

	@Override
	 // Compare student names
	 // Returns: < 0 if s1 is smaller than s2
	 //			0 if s1 equals s2
	 //			> 0 if s1 is larger than s2
	public int compare(Student s1, Student s2) {
		String name1 = s1.getName().toLowerCase();
		String name2 = s2.getName().toLowerCase();
		
		return name1.compareTo(name2);
	}
}
